package com.atguigu.szdz.dcsyl.config;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Component
public class SwaggerConfig {

    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.OAS_30) // v2 不同
                .enable(true) //是否启用swagger
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.atguigu.szdz.dcsyl.controller")) // 设置扫描路径
                .paths(PathSelectors.any())
                .build();
    }
}
